package com.pengshun.modules.api.order.service.dto;

import com.fasterxml.jackson.annotation.JsonFormat;
import com.pengshun.modules.api.coal.validator.First;
import com.pengshun.modules.api.coal.validator.Second;
import com.pengshun.modules.api.coal.validator.Third;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import javax.persistence.*;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotNull;
import java.math.BigDecimal;
import java.util.Date;

/**
 * table name:  ps_income_record
 * author name: llg
 * create time: 2020-12-10 10:29:05
 */

@Data
public class IncomeRecordDto {

	@Id
	private Long incomeRecordId;

	@ApiModelProperty(value = "用户id")
	private Long userId;

	/** 账单号 */
	private String billNo;

	@ApiModelProperty(value = "交易金额")
	@Min(value =1 ,message = "提现金额最低1元")
	@NotNull(message = "提现金额不能为空", groups = {First.class})
	private BigDecimal amount;

	@ApiModelProperty(value = "交易记录收支类型1收入2支出")
	private Integer paymentType;

	@ApiModelProperty(value = "账单类型1订单支付2货运结算3煤款收入4运费收入5充值6提现7退款8其他")
	private Integer billType;
	@NotNull(message = "银行卡id不能为空", groups = {First.class})
	private Long userBankId;

	/** 支付id,充值id,提现id,结算id 退款id */
	private Long id;

	/** 付款方式(1余额，2微信，3支付宝) */
	private  Integer way;

	@ApiModelProperty(value = "类型描述")
	private String remark;
	private String name;
	private String photo;
	private String cause;
	/**  辅助id */
	private Long  subsidiaryId;



	/** 1成功,2失败 */
	private  Integer status;
	@NotNull(message = "充值金额不能为空", groups = {Second.class})
	private Integer money;

	@ApiModelProperty(value = "交易日期")
	@JsonFormat(timezone = "GMT+8", pattern = "yyyy-MM-dd HH:mm:ss")
	private Date createTime;

	/** 1钱包2流水 */
	private Integer recordType;

	public IncomeRecordDto(Long userId, String billNo, BigDecimal amount, Integer paymentType, Integer billType, Long id, Integer way, String remark,
						   Integer status, Date createTime,Integer recordType,String name,String photo,Long  subsidiaryId) {
		this.userId = userId;
		this.billNo = billNo;
		this.amount = amount;
		this.paymentType = paymentType;
		this.billType = billType;
		this.id = id;
		this.way = way;
		this.remark = remark;
		this.status = status;
		this.createTime = createTime;
		this.recordType=recordType;
		this.name=name;
		this.photo=photo;
		this.subsidiaryId=subsidiaryId;
	}

	public IncomeRecordDto() {
	}


}

